﻿
using System;
using Okarito;
using Okarito.Utility;

namespace TestClient
{
    class Program
    {
        static void Main(string[] args)
        {
            // load the credentials to use
            Uri server;
            string userName;
            string password;
            AuthenticationUtility.GetCredentials(out server, out userName, out password);

            FogBugzClient client = new FogBugzClient(server);
            using (client.LogOn(userName, password))
            {
                Console.WriteLine("INTERVALS:");
                var intervals = client.GetIntervals(DateTime.Now).Result;
                foreach (var interval in intervals)
                    Console.WriteLine("{0}, {1}, {2}, {3}", interval.BugId, interval.Start, interval.End, interval.Duration);
                Console.WriteLine();

                Console.WriteLine("FILTERS:");
                var filters = client.GetFilters().Result;
                foreach (var filter in filters)
                    Console.WriteLine("{0}, {1}", filter.Type, filter.Title);
                Console.WriteLine();
            }
        }
    }
}
